/*
 * short_message.h
 *
 *  Created on: 2008-12-2
 *      Author: fanliangliang
 */

#ifndef SHORT_MESSAGE_H_
#define SHORT_MESSAGE_H_

#include <string>
#include <vector>

using std::string;
using std::vector;

class ShortMessage {
public:
	ShortMessage();
	~ShortMessage();

	bool setText(const string& text);
	bool addPhoneNumber(const string& phoneNumber);

	const string& text() const;
	size_t phoneNumberCount() const;
	const string& phoneNumberAt(size_t index) const;

	size_t packageLength() const;
	size_t package(char* buffer, size_t length) const;
	bool unpackage(const char* buffer, size_t length) const;

private:
	string truncate(const string& s, size_t size);

private:
	string _text;
	vector<string> _phoneNumbers;
};

#endif /* SHORT_MESSAGE_H_ */
